/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package b_and_b_properties;

import b_and_b_properties.data.DAO;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author LeQuan
 */
public class woOptions extends JFrame {

    private JButton newWO;
    private JButton viewWO;
    private DAO dao;

    public woOptions(final DAO dao) {
        super("Work Order Options");
        this.dao = dao;
        
        setLayout(new GridLayout(1, 1));
        setSize(250, 100);

        newWO = new JButton("New Workorder");
        add(newWO);
        viewWO = new JButton("View Workorder");
        add(viewWO);

        newWO.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                WorkOrder wo = new WorkOrder(dao);
                wo.setVisible(true);
            }
        });

        viewWO.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(null, "Work in Progress");
            }
        });

    }
}
